<project xmlns="http://maven.apache.org/POM/4.0.0"
		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
  		 			    	 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
    	<groupId>${project.package}</groupId>
    	<artifactId>${project.name}-parent</artifactId>
    	<version>0.0.1</version>
  	</parent>
	<groupId>${project.package}</groupId>
	<artifactId>${project.name}</artifactId>
	<version>0.0.1</version>
	<name>${project.name}</name>
	<description>${project.name}</description>
	<url>http://</url>
	<packaging>war</packaging>

	<build>
		<directory>target</directory>
		<outputDirectory>target/classes</outputDirectory>
		<testOutputDirectory>target/test-classes</testOutputDirectory>
		
		<plugins>	
			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
			   	<executions>
			    	<execution>
			    		<id>clean-logs</id>
			        	<phase>prepare-package</phase>
			            <configuration>
			            	<tasks>
								<delete dir="src/main/webapp/WEB-INF/logs" includeemptydirs="true" quiet="true" />
			              	</tasks>
			            </configuration>
			        	<goals>
			            	<goal>run</goal>
			            </goals>
			    	</execution>
				</executions>
			</plugin>
			
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>unpack-core</id>
						<phase>clean</phase>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>${project.package}</groupId>
									<artifactId>${project.name}-core</artifactId>
									<version>0.0.1</version>
									<type>jar</type>
									<overWrite>true</overWrite>
								</artifactItem>
							</artifactItems>
							<includes>**/*</includes>
							<outputDirectory>target/classes</outputDirectory>
						</configuration>
						<goals>
							<goal>unpack</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
[#noparse]

	<dependencies>		
		<dependency>
			<groupId>org.springframework.webflow</groupId>
			<artifactId>spring-js</artifactId>
			<version>${spring.js.version}</version>
			<scope>runtime</scope>
		</dependency>
		
		<dependency>
			<groupId>org.tuckey</groupId>
			<artifactId>urlrewritefilter</artifactId>
			<version>${urlrewritefilter.version}</version>
			<scope>runtime</scope>				
		</dependency>	

		<dependency>
			<groupId>org.freemarker</groupId>
			<artifactId>freemarker</artifactId>
			<version>${freemarker.version}</version>
		    <scope>runtime</scope>
			<exclusions>
				<exclusion>
					<groupId>org.apache.ant</groupId>
					<artifactId>ant</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.apache.ant</groupId>
					<artifactId>ant-launcher</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
		    <groupId>opensymphony</groupId>
		    <artifactId>sitemesh</artifactId>
		    <version>${sitemesh.version}</version>
		    <scope>runtime</scope>
		</dependency>
		
    	<!-- Insert dependencies for modules here -->
	</dependencies>
[/#noparse]
	
	<profiles>
		<profile>
			<activation>
				<property>
					<name>project</name>
					<value>refresh</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-antrun-plugin</artifactId>
					   	<executions>
					    	<execution>
					    		<id>create-directories</id>
					        	<phase>clean</phase>
					            <configuration>
					            	<tasks>
										<mkdir dir="src/main/webapp/images" />
										<mkdir dir="src/main/webapp/scripts" />
										<mkdir dir="src/main/webapp/styles" />
										<mkdir dir="src/main/webapp/WEB-INF/decorators" />
					              	</tasks>
					            </configuration>
					        	<goals>
					            	<goal>run</goal>
					            </goals>
					    	</execution>
					    </executions>
					</plugin>
					
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-dependency-plugin</artifactId>
						<executions>
							<execution>
								<id>unpack-css</id>
								<phase>clean</phase>
								<configuration>
									<artifactItems>
										<artifactItem>
											<groupId>com.googlecode</groupId>
											<artifactId>css4mvc</artifactId>
											<version>[#noparse]${css4mvc.version}[/#noparse]</version>
											<type>jar</type>
											<overWrite>false</overWrite>
										</artifactItem>
									</artifactItems>
									<includes>emastic/**/*, fugue-sprite/**/*</includes>
									<outputDirectory>src/main/webapp/styles</outputDirectory>
								</configuration>
								<goals>
									<goal>unpack</goal>
								</goals>
							</execution>
							<execution>
								<id>unpack-js</id>
								<phase>clean</phase>
								<configuration>
									<artifactItems>
										<artifactItem>
											<groupId>com.googlecode</groupId>
											<artifactId>js4mvc</artifactId>
											<version>[#noparse]${js4mvc.version}[/#noparse]</version>
											<type>jar</type>
											<overWrite>false</overWrite>
										</artifactItem>
									</artifactItems>
									<includes>jquery/**/*</includes>
									<outputDirectory>src/main/webapp/scripts</outputDirectory>
								</configuration>
								<goals>
									<goal>unpack</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
														
					<plugin>
		          		<groupId>org.apache.maven.plugins</groupId>
		          		<artifactId>maven-eclipse-plugin</artifactId>
		          		<version>2.5.1</version>
					   	<executions>
					    	<execution>
					        	<phase>clean</phase>
					        	<configuration>
					        		<workspace>../</workspace>
									<!-- <downloadSources>true</downloadSources>
          							<downloadJavadocs>true</downloadJavadocs> -->
									<projectnatures>
										<projectnature>org.eclipse.jdt.core.javanature</projectnature>
										<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
									</projectnatures>
									<buildcommands>
										<buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
										<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
									</buildcommands>
					        	</configuration>
					        	<goals>
					            	<goal>configure-workspace</goal>
					            	<goal>clean</goal>
					            	<goal>eclipse</goal>
					            </goals>
					    	</execution>
						</executions>
		        	</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
	
	<properties>
		<spring.js.version>2.0.9.RELEASE</spring.js.version>
		<freemarker.version>2.3.16</freemarker.version>
		<sitemesh.version>2.4.2</sitemesh.version>
		<urlrewritefilter.version>3.1.0</urlrewritefilter.version>
		<css4mvc.version>0.0.4</css4mvc.version>
		<js4mvc.version>0.0.3</js4mvc.version>
	</properties>
</project>